package com.myserver.util;

import net.sf.json.JSONObject;

import java.io.*;

public class JsonConfigUtil {
    public static JSONObject getJsonObject(String file){
        try {
            InputStream is = new FileInputStream(file);
            BufferedReader br = new BufferedReader(new InputStreamReader(is));
            StringBuilder sb = new StringBuilder();
            String str = "";
            while ((str = br.readLine())!=null){
                sb.append(str);
            }
            JSONObject jo = JSONObject.fromObject(sb.toString());
            return jo;
        } catch (IOException e) {
            e.printStackTrace();
            return null;
        }
    }
}
